#ifndef __NEWGRIDACTION_H
#define __NEWGRIDACTION_H

#include <sigc++/sigc++.h>
#include <gtkmm/dialog.h>
#include <gtkmm/box.h>
#include <gtkmm/label.h>
#include <gtkmm/table.h>
#include <gtkmm/button.h>
#include <gtkmm/alignment.h>
#include <gtkmm/entry.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/eventbox.h>
#include <gtkmm/image.h>
#include <algorithm>
#include <iostream>
#include <string>
#include "viewer.h"
#include "gridData.h"
#include "modifyGridAction.h"


class viewer;

class newGridAction
{
	public:
		newGridAction(viewer* v);
		virtual ~newGridAction();
		gridData* getGridData();
		void freeMemory();
		void showNewDialog();
	
	private:
		Gtk::Dialog newDialog;
		Gtk::VBox vbox;
		Gtk::Label explanation;
		Gtk::Label widthL;
		Gtk::Table t;
		Gtk::Button button;
		Gtk::Alignment expAlignment;
		Gtk::Alignment tableAlignment;
		Gtk::Alignment buttonAlignment;
		Gtk::Entry widthE;
		gridData* gData;
		viewer* v;

		//Signal handlers
		virtual void on_create_grid_button_clicked();
  		virtual bool on_cell_clicked(GdkEventButton* event, int x, int y);
		virtual void on_grid_image_resized(Gdk::Rectangle& r, Gtk::EventBox* eb, int x, int y);
		virtual bool on_mouse_over_cell(GdkEventCrossing* event, int x, int y);
};

#endif